package cn.edu.guet.controller;

import cn.edu.guet.bean.personimf.Users;
import cn.edu.guet.bean.personimf.dgroup;
import cn.edu.guet.bean.personimf.grouppeople;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import cn.edu.guet.bll.personmes.personimfseritf;

import java.util.List;

@Controller
public class personimfController {

    @Autowired
    private personimfseritf personimfseritf;

//    public void setPersonimfserimpl(cn.edu.guet.bll.personmes.personimfseritf personimfseritf) {
//        this.personimfseritf = personimfseritf;
//    }

    @RequestMapping(value="html/personimfhtml/organxingxi.do")
    public List<dgroup> getdgroup(String pid){
        List<dgroup>list=personimfseritf.getdgroup(pid);
        return list;
    }
    @RequestMapping(value="html/personimfhtml/grouppeople.do")
    public List<grouppeople>getgrouppeople(String userid, int page){
        System.out.println(userid);
        System.out.println(page);
        grouppeople grouppeople=new grouppeople();
        grouppeople.setUserid(userid);
        grouppeople.setPage(page);
        List<cn.edu.guet.bean.personimf.grouppeople>list=personimfseritf.getgrouppeople(grouppeople);
        return list;
    }
    @RequestMapping(value="html/personimfhtml/getpeopleById.do")
    public List<grouppeople>getpeopleById(String userid, String username){
        System.out.println(userid);
        System.out.println(username);
        List<grouppeople>list=personimfseritf.getpeopleById(userid,username);
        return list;
    }
    public Users getUser(String userid){
        Users users=personimfseritf.getUser(userid);
        return users;
    }


}
